<script>
	$(function() {
		$( "#datefrom" ).datepicker();
		$( "#dateto" ).datepicker();
	});
	$(document).ready(function(){
		<!--
		var currentTime = new Date()
		var month = currentTime.getMonth() + 1
		var day = currentTime.getDate()
		var year = currentTime.getFullYear()
		$( "#dateto" ).val(month + "/" + day + "/" + year)
		//-->
	});
	</script>
<div class="top-bar">
					<h1>Laporan Aset Hapuskira</h1>
					<div class="breadcrumbs">
						<a href="/">Laman Utama</a> / <a href="#">Laporan</a>
					</div>
				<br />
</div>
<div class="table">
<?php echo $this->Form->create('Report');?>
	<fieldset>
		<legend>Tarikh</legend>
		<table class="listing form" cellpadding="0" cellspacing="0">
			<tr>
				<td>Tarikh Dari :</td>
				<td><input type="text" value="" id="datefrom"
					name="data[Report][datefrom]" style="width: 80px;"></td>
				<td>Tarikh Sehingga :</td>
				<td><input type="text" value="" id="dateto"
					name="data[Report][dateto]" style="width: 80px;"></td>
			</tr>
		</table>
	</fieldset>
	<fieldset>
		<legend>Lokasi</legend>
		<table class="listing form" cellpadding="0" cellspacing="0">
			<tr>
				<td>Kontinjen :</td>
				<td align="left"><?php echo $this->Form->input('contingent_id',array('empty' => '[SEMUA]','div' => false,'label'=>''))?>
				</td>
				<td>Daerah :</td>
				<td align="left"><?php echo $this->Form->input('district_id',array('empty' => '[SEMUA]','div' => false,'label'=>''))?>
				</td>
			</tr>
		</table>
	</fieldset>
	<?php echo $this->Form->end("Papar Laporan")?>
</div>
<p></p>
<div class="table">




	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th>Bil.</th>
			<th>Daerah</th>
			<th>Kategori</th>
			<th>Jenis</th>
			<th>Jumlah Semasa</th>
		</tr>
		<?php if(count($rows)<= 0) : ?>
		<tr>
			<td colspan="5"><div align="center" class="error">TIADA REKOD DITEMUI</div>
			</td>
		</tr>
		<?php endif;?>
		<?php
		$count = 0;
		foreach($rows as $IPD=>$cats):
			foreach($cats as $ck=>$types):
				foreach($types as $tk=>$val):
					$tr = null;
					if ($count++ % 2 == 0) {
						$tr = 'class="bg"';
					}
			?>
				<tr <?php echo $tr?>>
					<td><?php echo $count;?></td>
					<td><?php echo $IPD;?></td>
					<td><?php echo $ck?></td>
					<td><?php echo $tk?></td>
					<td class="last"><?php echo $val;?></td>
				</tr>
				<?php endforeach;?>
			<?php endforeach;?>
		<?php endforeach;?>
	</table>
	<?php if(count($rows)> 0) :?>
	<div align="right">[<?php echo $this->Html->link(__('Muat Turun PDF', true), array('action' => 'exportPdf'),array('target' => '_blank'));?>]</div>
	<?php endif;?>
</div>
